using Universal.Application.Contracts.Common;
using Universal.Application.Contracts.Dto.Permission;

namespace Universal.Application.Repositories;

/// <summary>
/// 权限服务
/// </summary>
public interface IPermissionService
{
    /// <summary>
    /// 获取用户可访问的菜单
    /// </summary>
    // Task<ApiResponse<List<MenuPermissionDto>>> GetUserMenusAsync(Guid userId);

    /// <summary>
    /// 获取用户按钮权限
    /// </summary>
    Task<ApiResponse<List<string>>> GetUserPermissionCodesAsync(Guid userId);

    /// <summary>
    /// 检查用户是否有指定权限
    /// </summary>
    Task<bool> HasPermissionAsync(Guid userId, string permissionCode);

    /// <summary>
    /// 分页获取权限列表
    /// </summary>
    Task<ApiResponse<PagedResult<PermissionViewDto>>> GetPermissionsPagedAsync(int pageIndex, int pageSize);

    /// <summary>
    /// 创建权限
    /// </summary>
    Task<dynamic> CreatePermissionAsync(CreatePermissionDto dto);

    /// <summary>
    /// 编辑权限
    /// </summary>
    Task<dynamic> UpdatePermissionAsync(Guid permissionId, UpdatePermissionDto dto);

    /// <summary>
    /// 删除权限
    /// </summary>
    Task<dynamic> DeletePermissionAsync(Guid id);

    //启用
    Task<dynamic> EnablePermissionAsync(Guid permissionId);

    // 禁用
    Task<dynamic> DisablePermissionAsync(Guid permissionId);

}